// *** first suggested in http://www.sencha.com/forum/showthread.php?p=309913 to solve the TimeField DST bug
Ext.override(Ext.form.TimeField, {
    // *** private
    initDateFormat: 'j/n/Y',

    parseDate: function(value) {
        if (!value || Ext.isDate(value)) {
            return value;
        }

        var id = this.initDate + ' ',
            idf = this.initDateFormat + ' ',
            v = Date.parseDate(id + value, idf + this.format), // *** handle DST. note: this.format is a TIME-only format
            af = this.altFormats;

        if (!v && af) {
            if (!this.altFormatsArray) {
                this.altFormatsArray = af.split("|");
            }
            for (var i = 0, afa = this.altFormatsArray, len = afa.length; i < len && !v; i++) {
                v = Date.parseDate(id + value, idf + afa[i]);
            }
        }

        return v;
    },

    setLimit: function(value, isMin, initial) {
        var d;

        if (Ext.isString(value)) {
            d = this.parseDate(value);
        } else if(Ext.isDate(value)) {
            d = value;
        }

        if (d) {
            var val = new Date(this.initDate).clearTime();

            // *** why use 59 seconds as the upper limit for the maxValue?
            // we should use ALL time values (e.g. hours, minutes, seconds & milliseconds) from the minValue
            val.setHours(d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());

            this[isMin ? 'minValue' : 'maxValue'] = val;
            if (!initial) {
                this.generateStore();
            }
        }
    },

    // *** no longer required -- let the TimeField's superclass (i.e. the ComboBox) handle beforeBlur()
    //*** i.e. select a value from the Store
    // by @mystix -- http://www.sencha.com/forum/showthread.php?p=337620
    beforeBlur: Ext.form.TimeField.superclass.beforeBlur
});